@extends('layout.app')

@section('content')
    <form action="{{ url('articles/'.$article -> id) }}" method="POST">
        <h1>Update</h1>
        {{ csrf_field() }}
        {{ method_field('PATCH') }}
        <div class="form-group{{ $errors->has('title') ? ' has-error' : '' }}">
            <label for="title">title</label>
            <input type="text" name="title" class="form-control" value="{{ $article -> title }}">
            @if ($errors->has('title'))
                <span class="help-block">
                    <strong>{{ $errors->first('title') }}</strong>
                </span>
            @endif
        </div>

        <div class="form-group{{ $errors->has('content') ? ' has-error' : '' }}">
            <label for="content">content</label>
            <textarea name="content" class="form-control" rows="10" cols="5">{{ $article -> content }}</textarea>
            @if ($errors->has('content'))
                <span class="help-block">
                    <strong>{{ $errors->first('content') }}</strong>
                </span>
            @endif
        </div>

        <input type="submit" value="发表文章" class="btn btn-primary form-control">
    </form>
@endsection